<template>
<div class="sw-wrapper">
  <swiper :options="swiperOptions" v-if="isSwiperShow">
    <swiper-slide v-for="item in swiperList" :key="item.id">
      <img src="{{item.imgUrl}}" class="swiper-img">
    </swiper-slide>
    <div class="swiper-pagination" slot="pagination"></div>
  </swiper>
  </div>
</template>
<script>
  export default {
    name: 'HomeSwiper',
    props:{
      swiperList:Array
    },
    data() {
      return {
        swiperOptions: {
          pagination: {
            el: '.swiper-pagination',
            
          },
         loop:true
        }
      }
    },
    computed: {
      swiper() {
        return this.$refs.mySwiper.$swiper
      }
    },
    mounted() {
      console.log('Current Swiper instance object', this.swiper)
      this.swiper.slideTo(3, 1000, false)
    }
  }
</script>
<style lang="stylus" scoped>

</style>